//
//  FXAccountInfoController.m
//  Cocoa-Fetion
//
//  Created by Ronnie on 08-12-24.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "FXAccountInfoController.h"

@implementation FXAccountInfoController

- (id) init
{
	if (![super initWithWindowNibName:@"InfoPanel"])
		return nil;
	return self;
}


- (void)setAccountInfo:(const FXUserInfo*)accountInfo
{
	const char* mobileNumP = [accountInfo getFetionAccount]->personal?[accountInfo getFetionAccount]->personal->mobile_no:"";
	NSString* mobileNum = [NSString stringWithUTF8String:mobileNumP?mobileNumP:""];
	[mobileNumField setStringValue:mobileNum];
	
	[fetionNumField setStringValue:[NSString stringWithFormat:@"%ld", [accountInfo userID]]];
	
	const char* nickNameP = [accountInfo getFetionAccount]->personal?[accountInfo getFetionAccount]->personal->nickname:"";
	NSString* nickName = [NSString stringWithUTF8String:nickNameP?nickNameP:""];
	[nickNameField setStringValue:nickName];
	
	
	const char* realNameP = [accountInfo getFetionAccount]->personal?[accountInfo getFetionAccount]->personal->name:"";
	NSString* realName = [NSString stringWithUTF8String:realNameP?realNameP:""];
	[realNameField setStringValue:realName];
	
	[impresaField setStringValue:[accountInfo userImpresa]];
	
	[accountInfoBox setTitle:[NSString stringWithFormat:@"%@'s information",[accountInfo userName]]];
	
}

@end
